Public Partial Class wfrmDataJS
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.TextBox1.Attributes.Add("OnKeyUp", "formataCPF(this,event)")
        Me.TextBox2.Attributes.Add("OnKeyUp", "formataData(this,event)")

        'Me.TextBox1.Attributes.Add("OnKeyUP", _
        ' " var xPos = PosicaoCursor(this); " & _
        ' " event = getEvent(event); " & _
        ' " var tecla = getKeyCode(event); " & _
        ' "       If (!teclaValida(tecla)) Then " & _
        ' " return; " & _
        ' " vr = this.value = filtraNumeros(filtraCampo(this)); " & _
        ' " tam = vr.length; " & _
        ' " if (tam >= 3 && tam < 6) " & _
        ' " this.value = vr.substr(0, 3) + '.' + vr.substr(3); " & _
        ' " else if (tam >= 6 && tam < 9) " & _
        ' " this.value = vr.substr(0, 3) + '.' + vr.substr(3, 3) + '.' + vr.substr(6); " & _
        ' "       ElseIf (tam >= 9) Then " & _
        ' " this.value = vr.substr(0, 3) + '.' + vr.substr(3, 3) + '.' + vr.substr(6, 3) + '-' + vr.substr(9); ")

    End Sub

End Class